<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //2、使用let声明的变量不会被"提升"。
        console.log(n3);  //undefined
        var n3=300;

        console.log(n4);  //异常,Cannot access 'n4' before initialization
        //在初始化之前不允许访问n4
        let n4=400;
    </script>
</body>
</html>